﻿using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

namespace Simple.Common
{
    /// <summary>
    /// 加密帮助类
    /// </summary>
    public class RsaHelper
    {
        /// <summary>
        /// 加密
        /// </summary>
        /// <param name="input"></param>
        /// <param name="salt"></param>
        /// <returns></returns>
        public static string Md5Encrypt(string input, string salt)
        {
            byte[] bytesToBeEncrypted = Encoding.UTF8.GetBytes($"{salt}{input}");         

            using (var md5 = MD5.Create())
            {
                var bytes = md5.ComputeHash(bytesToBeEncrypted);
                return Convert.ToBase64String(bytes);
            }
        }
    }
}
